/**
 * 定义Dep类，用于收集依赖和通知跟新
 */
export default class Dep {
    constructor() {
        this.subs = {};
    }

    addSub(target) {
        this.subs[target.uid] = target;
    }

    notify() {
        for(let uid in this.subs)  {
            this.subs[uid].update();
        }
    }
}